

package beans;

import java.beans.MethodDescriptor;
import java.beans.ParameterDescriptor;
import java.beans.SimpleBeanInfo;
import java.lang.reflect.Method;

import events.ImageEvent;

/**
 *
 * @author Benjamin
 */
public class SinkBeanBeanInfo extends SimpleBeanInfo {
    
    @Override
    public MethodDescriptor[] getMethodDescriptors() {
        try {            
            Class c = SinkBean.class;
            Class parameterTypes[] = new Class[1];
            parameterTypes[0] = ImageEvent.class;
            String name = "onImageProceed";
            Method method1;
            method1 = c.getMethod(name, parameterTypes);
            ParameterDescriptor pds[] = new ParameterDescriptor[1];
            pds[0] = new ParameterDescriptor();
            MethodDescriptor md1 = new MethodDescriptor(method1, pds);
            MethodDescriptor mds[] = { md1 };
            return mds;
        } catch (NoSuchMethodException ex) {
           System.out.println(ex.getMessage());
        } catch (SecurityException ex) {
        	System.out.println(ex.getMessage());
        }
        
        return null;
    }
    
}
